package com.xnyzc.lhy.common.penum.order;

/**
 * @Author: huxuekuo
 * @Date: 2019-08-10 09:56
 * @Description:
 */
public enum ECancelOrderType {

    replyBefore("0", "应答前乘客取消"), replyPassengersAfter("1", "应答后乘客取消"), replyDriverAfter("2", "应答后司机取消"),
    replyServiceAfter("3", "客服取消"), control("4", "⻛控取消");

    private String type;
    private String value;

    ECancelOrderType(String type, String value) {
        this.type = type;
        this.value = value;
    }

    public String getType() {
        return this.type;
    }

    public String getValue() {
        return this.value;
    }

    public static ECancelOrderType finaByType(String type) {
        ECancelOrderType eCallVehType;
        switch (type) {
            case "0":
                eCallVehType = ECancelOrderType.replyBefore;
                break;
            case "1":
                eCallVehType = ECancelOrderType.replyPassengersAfter;
                break;
            case "2":
                eCallVehType = ECancelOrderType.replyDriverAfter;
                break;
            case "3":
                eCallVehType = ECancelOrderType.replyServiceAfter;
                break;
            case "4":
                eCallVehType = ECancelOrderType.control;
                break;
            default:
                throw new IllegalArgumentException("未设置");
        }
        return eCallVehType;
    }
}
